package com.sina.auto.components.WebCaptureImpl;

import java.awt.image.BufferedImage;

import static com.sina.auto.components.WebCaptureImpl.CaptureEdit.checkRGB;
import static com.sina.auto.components.WebCaptureImpl.CaptureEdit.mergeImage;
import static com.sina.auto.components.WebCaptureImpl.CaptureEdit.overlapImage;
import static com.sina.auto.components.WebCaptureImpl.CreateDock.createDock;
import static com.sina.auto.components.WebCaptureImpl.CreateQRcode.createQRcode;

public class AddQRcode {
    public static BufferedImage addQRcode(String url, BufferedImage picture) throws Exception {
        BufferedImage dockpic = createDock("扫描二维码",picture.getWidth(),400,checkRGB(picture));
        return mergeImage(picture,overlapImage(dockpic,createQRcode(url)));
    }
}
